/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.longph.b3;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author Long
 */
public class b2 {
    public static void main(String[] args) throws IOException {
        File f=new File("long1.txt");
        f.createNewFile();
        int i=0;
        try {
            BufferedWriter bf = new BufferedWriter(new FileWriter("long1.txt"));
            bf.write("Anh Dong");
            bf.newLine();
            bf.write("20");
            bf.newLine();
            bf.write("Chi Tho");
            bf.newLine();
            bf.write("20");
            bf.close();
            BufferedReader br=new BufferedReader(new FileReader("long1.txt"));
            String a[]=new String[100];
            i=1;
            while(br.ready()){
            a[i]=br.readLine();i++;}
            } catch (Exception e) {
        }
        System.out.println(i);
    }
}

